INF
File Sections
The different
sections of an INF file fit together to provide the information used by the
setup functions during an installation. The central section that defines the
steps of the installation is the Install section.
The Install section provides an
overview of the installation process. Each line of an Install section has two parts. On
the left of the equals sign (=) is the key. On the right hand side, is a list
of one or more section titles. The key specifies the type of the sections that
are listed on the right.
To better
understand this, consider the following example of an Install section.
[MyInstallSection]
Copyfiles=DataFiles, ProgramFiles
Delfiles=OldFiles
UpdateInis=NewIniInfo
AddReg=NewRegistryInfo, MoreNewRegistryInfo
DelReg=OldRegistryInfo, MoreOldRegistryInfo
In the preceding
example, the CopyFiles key is given the values DataFiles and ProgramFiles.
These specify two Copy Files
sections in the INF file that contain the source filenames for the copying
operations necessary for the installation. You can specify one or more Copy
Files sections for
the CopyFiles key of an Install section.
Simliarly,
the Delfiles key specifies Delete Files.O07.L sections that contain information relevant
to file deletion operations. The UpdateInis key specifies Update
INI File sections
that contain information about updating entries in the INI file, and the AddReg
and DelReg keys specify Add Registry and Delete Registry sections that contain
information about adding or deleteing registry information.
For more
information about the types of sections that can be specified in an Install section, see the INF
File Format Reference.
The DestinationDirs section defines the target
directory for files listed in Copy Files, Rename Files2LKG_AQ, or Delete Files sections.
The SourceDisksNames section assigns an ordinal
value to each source disk. You can store additional information about the
source disks, such as a human-readable description in this section.
The SourceDisksFiles section maps the source
files to the ordinal values assigned in the SourceDisksNames section.
You can have
multiple platform-specific SourceDisksNames and SourceDisksFiles sections in an INF file.
You add a platform-specific suffix to the title of a SourceDisksNames or
SourceDisksFiles section to indicate that the information listed in that
section is platform-specific.
If the setup
functions find platform-specific SourceDisksNames and SourceDisksFiles
sections that match the user s
platform, the setup functions use the platform-specific sections. Otherwise the
setup functions use the default (non-suffixed) SourceDisksNames and SourceDisksFiles
sections.
For example,
consider the following sections from an INF file.
[SourceDisksNames]
1= NT CD , \default
[SourceDisksNames.mips]
1= NT CD , \mips
[SourceDisksNames.alpha]
1= NT CD , \alpha
If the user s machine was a MIPS-based system, the setup functions
use the information listed in the section titled SourceDisksNames.mips
and look for source files in the \mips directory of the specified source media.
For an
Intel-based system, no platform-specific section exists, and the setup
functions use the information listed in SourceDisksNames and look for
source files in the \default directory.
The Strings section maps strings keys,
values used as place-holders in an INF file and enclosed by percent signs (%),
to the printable strings they represent. You can use strings keys as
placeholders in an INF file for information that changes frequently or needs to
be localized.